find_package(Boost 1.77.0)
if(NOT Boost_FOUND)
    message("未找到boost1.77.0,将构建项目内自带的boost1.77.0")
    execute_process(COMMAND tar -zxvf boost_1_77_0.tar.gz
            WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/3rdlib/boost)
    if(UNIX)
        execute_process(COMMAND sh bootstrap.sh --prefix=${CMAKE_CURRENT_SOURCE_DIR}/boost_1_77_0_lib
                WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/3rdlib/boost/boost_1_77_0
                RESULTS_VARIABLE BOOST_BUILD_RET)
        execute_process(COMMAND ./b2
                WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/3rdlib/boost/boost_1_77_0
                RESULTS_VARIABLE BOOST_BUILD_RET)
    endif()
    set(CMAKE_PREFIX_PATH ${PROJECT_SOURCE_DIR}/3rdlib/boost/boost_1_77_0)
    #重新查找一次
    find_package(Boost 1.77.0 REQUIRED
            log
            date_time
            filesystem
            thread
            system)
    if(NOT Boost_FOUND)
        message(FATAL "未找到boost-1.77.0")
    endif()
endif()
#添加boost目录
include_directories(${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIRS})

#BOOST日志部分宏
add_compile_definitions(
        BOOST_LOG_DYN_LINK
        BOOST_LOG_USE_COMPILER_TLS
        BOOST_LOG_USE_STD_REGEX
)